﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace MESWebService
{
   
    public class LogHelp  
    {
        public static ILog loginfo = log4net.LogManager.GetLogger("loginfo");
        public static ILog logerror = log4net.LogManager.GetLogger("logerror");
        public static ILog logoracle = log4net.LogManager.GetLogger("logoracle");//add:Wangjh 2017-8-30 增加往数据库写入日志
        
        private static ILog myLog = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public static void SetConfig()
        {
            log4net.Config.XmlConfigurator.Configure();
        }

        public static void WriteLog(string strInfo)
        {
            loginfo.Info(strInfo);
        }

        public static void WriteError(string strInfo, Exception e)
        {
            logerror.Error(strInfo, e);
        }

        public static void WriteOrcale(string strInfo, params object[] args)//add:Wangjh 2017-8-30
        {
            logoracle.InfoFormat (strInfo, args);
        }
        public static void WriteOrcaleError(string strInfo, params object[] args)//add:Wangjh 2017-8-30
        {
            logoracle.ErrorFormat (strInfo, args);
        }


    }
}
